<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="./vue2.js"></script>
<body>
    <div id="box">
        <button @click="handleClick">ccc</button>
        <child :values="children" ref="ccc"></child>
    </div>
    <script>
        Vue.component("child",{
            props:{
                values:{
                    type:String,
                    default:''
                }
            },
            data(){
                return{
                    kkk:123
                }
            },
            template:`<div>{{this.values}}</div>`
        })
        new Vue({
            el:'#box',
            data:{
                children:'xxx'
            },
            methods:{
                handleClick(){
                    console.log(this.$refs.ccc);
                }
            }
        })
    </script>
</body>
</html>